]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
mpris: Do not send player-removed for a player that has never been added
authorMarco Trevisan (Treviño) <mail@3v1n0.net>
Thu, 16 Apr 2026 16:38:22 +0000 (18:38 +0200)
committerMarco Trevisan (Treviño) <mail@3v1n0.net>
Thu, 16 Apr 2026 17:54:49 +0000 (19:54 +0200)
We only emit player-added for players that can play, but we remove them
all, despite this state.

This causes a non-fatal warning during the removal of a non-existent
notification (that is in fact an undefined message)

Closes: https://gitlab.gnome.org/GNOME/gnome-shell/-/work_items/8284
Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/4183>

js/ui/mpris.js

index 44efbd64e1b69e4a1b2791875fd86825cc4a4fee..55231551fc723ef041af15da4a237878faccf47c 100644 (file)
@@ -244,7 +244,11 @@ export const MprisSource = GObject.registerClass({
             if (player) {
                 this._players.delete(name);
                 player.disconnectObject(this);
-                this.emit('player-removed', player);
+
+                // if !canPlay, the player has already been removed
+                // or was never exposed in our public players list
+                if (player.canPlay)
+                    this.emit('player-removed', player);
             }
         }